# coding: utf-8

cars = {'BMW': 8.5, 'BENS': 8.3, 'AUDI': 7.9}
# 获取'BMW'对应的value
print(cars.get('BMW'))  # 8.5
print(cars.get('PORSCHE'))  # None
print(cars['PORSCHE'])  # KeyError
